<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目报价方案</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>

<script type="text/javascript">
	var grid = null;
	$(function () {
		initGrid();//grid
	});
	
	//初始化列表
	function initGrid(){
		var params = {};
		$("#grid").ligerGrid({
			url: '<%=path%>/project/calquatprps/quatPrpsCfgMInitList.do',
	    	method : 'get',
	        columns: [
	            { display: '方案配置名称', name: 'prpsCfgNm', minWidth: 100, enabledSort:true},
	            { display: '所属机构', name: 'buOrgCdNm', minWidth: 150, enabledSort:true},
	            { display: '业务类型', name: 'prjQuatPrpsAttrPageVO.bizTypCdNm', minWidth: 100, enabledSort:true},
	            { display: '有效期', minWidth: 150,
	            	render: function (rowdata, rowindex, value){
	            		var expStDt = new Date(rowdata.expStDt);
	    	    		var expStDtStr = DateUtils.formatDate(expStDt, DateUtils.YYYY_MM_DD);
	            		var expEndDt = new Date(rowdata.expEndDt);
	    	    		var expEndDtStr = DateUtils.formatDate(expEndDt, DateUtils.YYYY_MM_DD);
			            return expStDtStr + " / " + expEndDtStr;
	            	}	
	            },
	            {
	                display: '操作',
	                isSort: false,
	                width: 200,
	                render: function (rowdata, rowindex, value){
	                	var h = '';
	                        h+='<a class="sq-button-hasicon" href="javascript:addPrjQuatPrps(';
	                        h+="'"+rowdata.id+"'";
	                        h+=')"><i class="sqBtnIco_3"></i>厂商贴息标准方案</a>';
	                    return h;
	                }
	            }
	        ],
	        pageSize:100,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        heightDiff:-2,
	        checkbox:false,
	        allowUnSelectRow: true,
            alternatingRow: false,
	        rownumbers:true,
	        usePagerOnLessPagesize: true,
	    });
		grid = liger.get("grid");
		grid.setHeight(300);
		
	}
	//格式化为人民币格式
	function renderAmt(rowdata, rowindex, value) {
        var h="￥" + FormatMoney(rowdata.SQMoney)
        return h;
    }

	//格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value&&value!=''){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
		}
		return dateStr;
	}
	
	//添加
	function addPrjQuatPrps(prpsCfgId){
		var callback = frameElement.dialog.get("callback");
		   parent.Add_navTab('tab_project_prd_detail','添加报价器方案','<%=path%>/project/calquatprps/toAddPage.do?prpsCfgId='+prpsCfgId,callback);
		frameElement.dialog.close();
	}

	function iframeResize () {
	    if (parent.mainApp) {
	        parent.mainApp.parentTab.onResize();
	    };
	}
</script>

<body class="iframeBody">
	<div class="Wrapper">
        <div>
           <div id="pageInTab" class="pageInTab">
<div id="grid" class="sq-grid"></div>
</div>
	</div>
		</div>
			</div>
</body>
</html>